public class Farm extends Structure {
	public int size;
	public boolean produceReady;

	public Farm(int _id, Player player) {
		super(_id, player);
		this.clockStep = 0;
		this.type = 11;
		this.player = player;
		this.offensive = 0;
		this.defensive = 0;
		this.armor = 5;
		this.production = 1000;
		this.health = 300;
		this.size = 2000;
		this.produceReady = false;
	}

	public void doCreate(Map m) {

		if (this.powerDelay > 0) {
			if (this.mode != "SLEEP") {
				this.powerDelay--;
				if (this.powerDelay == 0) {
					this.mode = "STANDBY";
				}
			}
		} else {
				player.food+=15;
		}
	}
	
	public void produceFood(Unit u) {
		produceReady = false;
		if (clockStep == production) {
			produceReady = true;
			clockStep = 0;
		}
		clockStep++;
	}
}
